package com.huyn.baseframework.statistics;

/**
 * 统计事件
 * Created by huyaonan on 16/11/18.
 */
public class AubeStatisticEvents {

    public static final String INTERACT_DISPLAY = "INTERACT_DISPLAY";
    public static final String INTERACT_EXPAND = "INTERACT_EXPAND";
    public static final String INTERACT_JOIN = "INTERACT_JOIN";
    public static final String INTERACT_OPTION_SELECT = "INTERACT_OPTION_SELECT";

    public static final String GOODS_LABEL_DISPLAY = "GOODS_LABEL_DISPLAY";
    public static final String GOODS_POINT_DISPLAY = "GOODS_POINT_DISPLAY";
    public static final String GOODS_LABEL_CLICK = "GOODS_LABEL_CLICK";
    public static final String GOODS_POINT_CLICK = "GOODS_POINT_CLICK";
    public static final String GOODS_DETAIL_DISPLAY = "GOODS_DETAIL_DISPLAY";
    public static final String GOODS_ADD_FAVOR = "GOODS_ADD_FAVOR";
    public static final String GOODS_CACEL_FAVOR = "GOODS_CACEL_FAVOR";

    public static final String MULTIVIDEO_DISPLAY = "MULTIVIDEO_DISPLAY";
    public static final String MULTIVIDEO_PIP = "MULTIVIDEO_PIP";
    public static final String MULTIVIDEO_CLICK = "MULTIVIDEO_CLICK";

    public static final String VIDEO_PLAY_TIMES = "VIDEO_PLAY_TIMES";

    public static final String VIDEO_PLAY_DURATION = "VIDEO_PLAY_DURATION";

    public static final String VIDEO_EXIT_TIME = "VIDEO_EXIT_TIME";

    public static final String VIDEO_PLAY_DATATRAFFICT = "DATA_TRAFFIC";

    public static final String VIDEO_PLAY_COUNTT= "PLAY_COUNT";

    /**
     * 返回一个JSONObject格式的字符串
     * @param values
     * @return
     */
    public static String formatValues(EventValuePair... values) {
        if(values != null) {
            StringBuffer sb = new StringBuffer();
            int index = 0;
            sb.append("{");
            for(EventValuePair item : values) {
                if(index > 0)
                    sb.append(",");
                sb.append("\"").append(item.key).append("\":\"").append(item.value).append("\"");
                index++;
            }
            sb.append("}");
            return sb.toString();
        }
        return null;
    }

}
